﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleFactoryPattern
{
    /// <summary>
    /// 工厂类角色Creator (LightSimpleFactory)：工厂类在客户端的直接控制下（Create方法）创建产品对象。
    /// </summary>
    public class LightSimpleFactory
    {
        public Light Create(string LightType)
        {
            if (LightType == "Bulb")
                return new BulbLight();
            else if (LightType == "Tube")
                return new TubeLight();
            else
                return null;
        }
    }
}
